﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using PccCommonForC;

public partial class Manager_Authority_AddAuthority : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["AdminUserID"] == null)
        {
            Response.Write("<script language=javascript>alert('Time is out.');window.open('../Default.aspx','_top');</script>");
            return;
        }
       if (Session["IsAdmin"] != "S")
       {
           Response.Redirect("Authority.aspx");
       }
    }


   
    private void ReturnPage()
    {
        Response.Redirect("Authority.aspx?CodeID=" + Request.QueryString["CodeID"]);
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        PccMsg msg = new PccMsg();
        msg.CreateFirstNode("AutNm", txtMenu.Text);
        msg.CreateFirstNode("Descript", txtURL.Text);
        msg.CreateFirstNode("Status", "");
        msg.CreateFirstNode("UpdID", "0");

        clsWebShop cls = new clsWebShop();
        cls.Ins_shr_Authority(msg.GetXmlStr.ToString());
        ReturnPage();
    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        ReturnPage();
    }
}
